import { BasicColumn, FormSchema } from '/@/components/Table';
// 表格字段
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'username',
  },
  {
    title: '层级',
    dataIndex: 'level',
  },
  {
    title: '手机号码',
    dataIndex: 'phone',
  },
  {
    title: '微信号',
    dataIndex: 'chat',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',
  },
  {
    title: '状态',
    dataIndex: 'status',
  },
  {
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
    width: 160,
  },
];
// 表单
export const searchFormSchema: FormSchema[] = [
  {
    field: 'username',
    label: '姓名',
    component: 'Input',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '请输入姓名',
    },
  },
  {
    field: 'phonenumber',
    label: '手机号',
    component: 'Input',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '请输入手机号',
    },
  },
  {
    field: 'chat',
    label: '微信号',
    component: 'Input',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '请输入微信号',
    },
  },
  {
    field: 'level',
    label: '层级',
    component: 'Input',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '请输入手机号',
    },
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      placeholder: '请选择状态',
      options: [
        { label: '正常', value: '正常' },
        { label: '禁用', value: '禁用' },
      ],
    },
    colProps: { span: 4 },
  },
];

// 表格数据
export const dataSource = [
  {
    id: 1,
    username: '曾阿牛',
    level: '一级',
    phone: '18120553659',
    chat: '18120553659',
    createTime: '2021-5-20 13:20:20',
    status: '正常',
    email: 'ZAN@123.com',
    redBook: 'ZAN@123.com',
    instargran: 'ZAN@123.com',
    seoTitle: 'seo标题',
    seoDesc: 'seo描述',
    seoKeyWord: 'seo关键字',
    seoUrl: 'seo-URL',
    pic: 'pic-URL',
    remark: '简介',
  },
  {
    id: 2,
    username: '曾阿牛',
    level: '二级',
    phone: '18120553659',
    chat: '18120553659',
    createTime: '2021-5-20 13:20:20',
    status: '禁用',
    email: 'ZAN@123.com',
    redBook: 'ZAN@123.com',
    instargran: 'ZAN@123.com',
    seoTitle: 'seo标题',
    seoDesc: 'seo描述',
    seoKeyWord: 'seo关键字',
    seoUrl: 'seo-URL',
    pic: 'pic-URL',
    remark: '简介',
  },
];

export const getAccountList = () => {
  return dataSource;
};

export const accountFormSchema: FormSchema[] = [
  {
    field: 'username',
    label: '姓名',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'level',
    label: '层级',
    component: 'Select',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请选择',
      options: [
        { label: '一级', value: '一级' },
        { label: '二级', value: '二级' },
      ],
    },
  },
  {
    field: 'email',
    label: '邮箱',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'phone',
    label: '电话',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'chat',
    label: '微信号',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'redBook',
    label: '小红书账号',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'instargran',
    label: 'Instargran账号',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'seoTitle',
    label: 'SEO标题',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'seoDesc',
    label: 'SEO描述',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'seoKeyWord',
    label: 'SEO关键字',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'seoUrl',
    label: 'SEO-URL',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'pic',
    label: '图片ALT',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    label: '简介',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      rows: 4,
      placeholder: '请输入',
    },
    dynamicRules: () => {
      return [
        {
          required: false,
          max: 200,
          message: '简介不能超过200字',
        },
      ];
    },
  },
];
